@use "var.scss" as *;

// =========================== 页面样式 =======================

.border {
  border: 1px solid var(--el-card-border-color) !important;
}

@mixin general-card {
  border: none;
  &.is-always-shadow {
    box-shadow: none;
  }
}

.simple-card.el-card {
  @include general-card;
}

/* 表单card */
.form-card.el-card {
  margin-bottom: 8px;
  @include general-card;

  .el-card__body {
    padding: 16px 16px 0 16px;
  }
}

.content-card.el-card {
  position: relative;
  @include general-card;

  .el-card__body {
    padding: 16px;
  }

  .el-card__header {
    border: none;
    padding: 14px 16px;
    color: var(--el-text-color-regular);
    display: flex;
    align-items: center;
    justify-content: space-between;

    .card-header-title {
      font-size: 16px;
    }

    .card-header-extra {
      display: flex;
      align-items: center;

      .el-button--text {
        height: auto;
        padding: 0;
      }

      .card-header-extra-options {
        display: inline-block;
      }

      .card-header-extra-action {
        margin-left: 16px;
      }
    }
  }
}

.table-wrapper {
  margin-top: 16px;

  .el-scrollbar {
    min-height: 457px;
  }

  .table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
  }

  .el-button + .el-button {
    margin-left: 9px;
  }

}

.config-list {
  margin: 0 20px 15px 20px;
}

.table-empty.el-empty {
  --el-empty-padding: 38px 0;
  --el-empty-image-width: 46px;
  line-height: 32px;
  --el-empty-description-margin-top: 4px;
}

.page-header {
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
  background-color: var(--el-bg-color);
  overflow: hidden;

  &.transparent {
    background-color: transparent;
    border: none;
  }

  .page-header-title {
    font-size: 20px;
    line-height: 32px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--el-text-color-primary);
  }

  .page-header-container {
    margin-top: 12px;
  }
}

// =========================== 全局el-table弹框样式 =======================
.el-table {
  .el-table__header th.el-table__cell {
    color: var(--el-text-color-regular);
    background-color: var(--el-fill-color-light) !important;
  }

  &.el-table--default .el-table__cell {
    padding: 10px 0;
  }

  .el-popper {
    max-width: 50vh !important;
  }
}

// =========================== 全局el-dialog弹框样式 =======================
.el-dialog {
  padding: 0;

  &.hidden-border {
    .el-dialog__header {
      border-bottom: none;
    }

    .el-dialog__footer {
      border-top: none;
      border-bottom: none;
    }
  }

  &.footer-center {
    .el-dialog__footer {
      text-align: center;
      border-top: none;
      border-bottom: none;
    }
  }

  &.hidden-horizontal {
    .el-scrollbar__bar.is-horizontal {
      display: none !important;
    }
  }

  .el-dialog__header {
    padding: 13px 16px;
    margin-right: 0;
    border-bottom: 1px solid var(--el-border-color);

    .el-dialog__headerbtn {
      top: 0;
    }
  }

  .el-dialog__body {
    padding: 16px;
  }

  .el-dialog__footer {
    padding: 13px 16px;
    border-top: 1px solid var(--el-border-color);
  }
}

@media (max-width: $sm) {
  .el-dialog {
    width: auto !important;
  }
}

// =========================== 全局el-drawer抽屉样式 =======================
.el-drawer {
  .el-drawer__header {
    border-bottom: 1px solid var(--el-border-color);
    padding: 13px 16px;
    margin-bottom: 0;

    .el-drawer__title {
      font-size: 16px;
      font-weight: 500;
      color: var(--el-text-color-primary);
    }
  }

  .el-drawer__body {
    padding: 16px;
  }

  .el-drawer__footer {
    border-top: 1px solid var(--el-border-color);
    padding: 12px 16px;
  }
}

@media (max-width: $sm) {
  .el-drawer {
    width: 100% !important;
  }
}

// 表单条目宽度满填充
.full-form,
.el-form {
  .el-cascader,
  .el-input-number,
  .el-dropdown,
  .el-select,
  .el-input {
    width: 100%;
  }
}

.data-form {
  .el-input-number {
    max-width: 12rem;
  }

  .el-select {
    max-width: 15rem;
  }
}

span.tip {
  color: #AAA;
  margin-top: 3px;
  font-size: 13px;
  margin-left: 6px;
  line-height: 24px;
}

.el-form-item__content:hover {
  span.tip {
    color: #2cbca3;
  }
}

.btn-dashed {
  border-style: dashed;
}

.text-right {
  text-align: right;
}

.text-danger {
  color: var(--el-color-danger);
}

.text-success {
  color: var(--el-color-success);
}

.btn-long {
  width: 100%;
}

.icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  fill: currentColor;
  color: inherit;
  font-size: inherit;

  &.form-label-icon {
    margin-left: 2px;
    vertical-align: -0.125rem;
    font-size: 14px;
  }
}

.no-arrow-popper.el-popper {
  .el-popper__arrow {
    display: none;
  }
}

.circle {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  margin-bottom: 2px;
  border-radius: 50%;
  text-align: center;
  background-color: var(--el-color-info);

  --circle-animation-color1: var(--el-color-info-light-9);
  --circle-animation-color2: var(--el-color-info);

  &.primary {
    background-color: var(--el-color-primary);
    --circle-animation-color1: var(--el-color-primary-light-9);
    --circle-animation-color2: var(--el-color-primary);
    animation: circle-animation 3s ease-in-out infinite;
  }

  &.success {
    background-color: var(--el-color-success);
    --circle-animation-color1: var(--el-color-success-light-9);
    --circle-animation-color2: var(--el-color-success);
    animation: circle-animation 3s ease-in-out infinite;
  }

  &.warning {
    background-color: var(--el-color-warning);
    --circle-animation-color1: var(--el-color-warning-light-9);
    --circle-animation-color2: var(--el-color-warning);
    animation: circle-animation 3s ease-in-out infinite;
  }

  &.danger {
    background-color: var(--el-color-danger);
    --circle-animation-color1: var(--el-color-danger-light-9);
    --circle-animation-color2: var(--el-color-danger);
    animation: circle-animation 3s ease-in-out infinite;
  }

  &.error {
    background-color: var(--el-color-danger);
    --circle-animation-color1: var(--el-color-danger-light-9);
    --circle-animation-color2: var(--el-color-danger);
    animation: circle-animation 3s ease-in-out infinite;
  }

  &.info {
    background-color: var(--el-color-info);
    --circle-animation-color1: var(--el-color-info-light-9);
    --circle-animation-color2: var(--el-color-info);
    animation: circle-animation 3s ease-in-out infinite;
  }
}

@keyframes circle-animation {
  0% {
    border-color: var(--circle-animation-color1);
    box-shadow: 0 0 3px var(--circle-animation-color1);
  }
  50% {
    border-color: var(--circle-animation-color2);
    box-shadow: 0 0 6px var(--circle-animation-color2);
  }
  100% {
    border-color: var(--circle-animation-color1);
    box-shadow: 0 0 3px var(--circle-animation-color1);
  }
}

// =========================== 滚动条隐藏 =======================

.scrollbar-hide {
  // Firefox浏览器
  scrollbar-width: none;
  scrollbar-color: transparent transparent;

  &::-webkit-scrollbar {
    width: 0;
  }

  &::-webkit-scrollbar-track {
    background-color: transparent;
  }
}

// =========================== 隐藏动画 =======================

.hide-enter-active {
  transition: all 0.3s ease;
}

.hide-leave-active {
  transition: all 0.5s ease;
}

.hide-enter-from,
.hide-leave-to {
  opacity: 0;
}

.fixed-width {
  .el-button--small {
    padding: 1px 9px;
    line-height: 1.5;
    font-weight: 400;
    min-width: 40px;
  }

  .el-button + .el-button {
    margin-left: 6px;
  }
}

.el-radio {
  margin-right: 12px;
}

.el-radio.el-radio--small {
  height: 28px;
}

.el-button {
  --el-button-font-weight: 400;
  --el-font-size-base: 13px;
}

.el-popconfirm__icon {
  font-size: 16px;
}

.dynamic-form {
  width: 540px;
  border-radius: 6px;
  padding: unset;
  max-width: 540px;

  .el-message-box__header {
    padding: 13px;
    border-bottom: 1px solid var(--el-border-color);
  }

  .el-message-box__headerbtn {
    height: 50px;
    width: 50px;
    vertical-align: -0.15em;
  }

  .el-message-box__title {
    font-size: 14px;
    font-weight: 500;
  }

  .el-message-box__content {
    padding: 30px 15px 10px;
    font-size: 14px;
  }

  .el-message-box__btns {
    padding: 5px 15px 15px 15px;
  }

  .el-form-item__label,
  .el-form-item__content {
    font-size: var(--el-font-size-base);
  }
}

.el-tabs__nav-wrap:after {
  height: 1px;
}

.el-tag + .el-tag {
  margin-left: 6px;
}

.el-divider--horizontal {
  margin: 21px 0;
}

.el-cascader {
  .el-input {
    min-height: 36px;
  }
}

.el-table,
.el-table--default,
.el-divider__text,
.el-step__title {
  font-size: var(--el-font-size-base);
}

.el-page-header__content {
  font-size: 14px;
  font-weight: 600;
}

.el-alert {
  --el-alert-title-font-size: var(--el-font-size-base);
  --el-alert-description-font-size: var(--el-font-size-base);
}

.el-input-number .el-input__inner {
  text-align: left;
}

.el-input__suffix-inner > :first-child {
  line-height: 30px;
}

.el-space--horizontal {
  .el-divider--vertical {
    margin: 0 5px;
  }
}
